import { CopyOutlined, FolderAddOutlined, NumberOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import React from 'react';

import styles from '../styles.module.less';

const KeyButtons = ({
  setBackupVisible,
  setbackupModalTitle,
  setKeyCreateVisible,

  setGenRandomNumberVisible,
}: {
  setBackupVisible: (visible: boolean) => void;
  setbackupModalTitle: (title: string) => void;
  setKeyCreateVisible: (visible: boolean) => void;
  setKeyImportVisible: (visible: boolean) => void;
  setGenRandomNumberVisible: (visible: boolean) => void;
}) => {
  return (
    <>
      <div className={styles.Container}>
        <div>
          <Button
            type="primary"
            ghost
            icon={<FolderAddOutlined />}
            style={{ marginLeft: '4px', backgroundColor: '#eff3fe' }}
            onClick={() => setKeyCreateVisible(true)}
            // disabled={LocalInfo.getRoleId() === 2}
          >
            密钥创建
          </Button>
          {/* <Button
            type="primary"
            ghost
            icon={<DeliveredProcedureOutlined />}
            style={{ marginLeft: '10px', backgroundColor: '#eff3fe' }}
            onClick={() => setKeyImportVisible(true)}
          >
            密钥导入
          </Button> */}
          <Button
            type="primary"
            ghost
            icon={<CopyOutlined />}
            style={{ marginLeft: '10px', backgroundColor: '#eff3fe' }}
            onClick={() => {
              setbackupModalTitle('备份用户密钥');
              setBackupVisible(true);
            }}
            // disabled={LocalInfo.getRoleId() === 2}
          >
            密钥备份
          </Button>

          {/* <Button
            type="primary"
            ghost
            icon={<SnippetsOutlined />}
            style={{ marginLeft: '10px', backgroundColor: '#eff3fe' }}
            onClick={() => {
              setbackupModalTitle('恢复用户密钥');
              setBackupVisible(true);
            }}
          >
            密钥恢复
          </Button> */}

          <Button
            type="primary"
            ghost
            icon={<NumberOutlined />}
            style={{
              marginLeft: '10px',
              backgroundColor: '#eff3fe',
              width: '109px',
              display: 'none',
            }}
            onClick={() => {
              setGenRandomNumberVisible(true);
            }}
          >
            生成随机数
          </Button>
        </div>
      </div>
    </>
  );
};

export default React.memo(KeyButtons);
